package edu.uclm.combTest.core;

/**
 * Un élément est une string.
 * @author quentin
 *
 */
public final class Element {
	protected/*@ spec_public @*/ String value;

	//@requires value != null;
	//@ensures value == this.value;
	public Element(String value) {
		this.value=value;
	}

	//@ensures \result == value;
	public /*@ pure @*/String getValue() {
		return this.value;
	}

	//@requires value !=  null;
	// on ne test pas la props suivante car toString d'Object n'est pas pure.
	///@ensures this.value == value.toString();
	public void setValue(Object value) {
		this.value=value.toString();
	}

	public /*@ pure @*/String toString() {
		return this.value;
	}

	public /*@ pure @*/boolean equals(/*@nullable@*/ Object o) {
		if (!(o instanceof Element))
			return false;
		Element v=(Element) o;
		return this.value.equals(v.value);
	}
}
